package com.ytjj.qmyx.supplychain.mapper;


import com.ytjj.qmyx.supplychain.common.model.request.OrderProblemListRequest;
import com.ytjj.qmyx.supplychain.common.model.response.OrderProblemDetailResponse;
import com.ytjj.qmyx.supplychain.common.model.response.OrderProblemExportResponse;
import com.ytjj.qmyx.supplychain.common.model.response.OrderProblemListResponse;
import com.ytjj.qmyx.supplychain.mapper.entity.YxOrderProblem;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 订单问题表
 */

public interface YxOrderProblemMapper extends Mapper<YxOrderProblem> {

    YxOrderProblem selectById(@Param("id") Integer id);

    /**
     * 更新订单问题状态
     * @param id
     * @param status
     * @return
     */
    int updateStatus(@Param("id") Integer id,@Param("status") Integer status);

    /**
     * 修改订单问题的跟单处理状态
     * @param id
     * @param dealStatus
     * @return
     */
    Integer updateDealStatus(@Param("id")Integer id, @Param("dealStatus")  Integer dealStatus);

    /**
     * 根据条件查询记录
     * @param request
     * @return
     */
    List<OrderProblemListResponse> orderProblemList(OrderProblemListRequest request);

    /**
     * 根据主键id查询记录
     * @param id
     * @return
     */
    OrderProblemDetailResponse queryDetail(@Param("id") Integer id);

    /**
     * 导出问题记录
     * @param request
     * @return
     */
    List<OrderProblemExportResponse> exportOrderProblemList(OrderProblemListRequest request);

    /**
     * 修改问题加急状态
     * @param id
     * @param isUrgent
     * @return
     */
    Integer updateProblemUrgent(@Param("id")Integer id, @Param("isUrgent")Integer isUrgent);

    /**
     * 修改问题供应商处理状态
     * @param id
     * @param bankerDealStatus
     * @return
     */
    Integer updateProblemBankerDealStatus(@Param("id")Integer id, @Param("bankerDealStatus")Integer bankerDealStatus);

    /**
     * 根据订单号查询问题
     * @param childOrderNo
     * @return
     */
    List<YxOrderProblem> selectByChildOrderNo(@Param("childOrderNo")String childOrderNo);
}
